package xipujewel.xipujewel.entity.app;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import xipujewel.xipujewel.entity.IdEntity;

@Entity
@Table(name = "xipujiewel_ring")
public class Ring extends IdEntity { //戒托表
	private String name; //名称
	private String no; //款号
	private float mainBeginWeigh; //可镶主钻重量
	private float mainEndWeigh; //可镶主钻重量
	private String mainShape; //可镶主钻形状
	private float goldWeight; //金重>=
	private String quality; //材质
	private float minorWeigh; //副钻总重量>=
	private int sizeBegin; //指圈
	private int sizeEnd; //指圈
	private float price; //显示价格
	private String photo; //小图
	private String photo1; //大图1
	private String photo2; //大图2
	private String photo3; //大图3
	private String photo4; //大图4

	private RingType ringType;//戒托的类型，也就是重量
	private float secondPrice;//二级批发价

	private List<Order> orders = new ArrayList<Order>();//关联订单列表

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "rings")
	public List<Order> getOrders() {
		return orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public float getMainBeginWeigh() {
		return mainBeginWeigh;
	}

	public void setMainBeginWeigh(float mainBeginWeigh) {
		this.mainBeginWeigh = mainBeginWeigh;
	}

	public float getMainEndWeigh() {
		return mainEndWeigh;
	}

	public void setMainEndWeigh(float mainEndWeigh) {
		this.mainEndWeigh = mainEndWeigh;
	}

	public String getMainShape() {
		return mainShape;
	}

	public void setMainShape(String mainShape) {
		this.mainShape = mainShape;
	}

	public float getGoldWeight() {
		return goldWeight;
	}

	public void setGoldWeight(float goldWeight) {
		this.goldWeight = goldWeight;
	}

	public String getQuality() {
		return quality;
	}

	public void setQuality(String quality) {
		this.quality = quality;
	}

	public float getMinorWeigh() {
		return minorWeigh;
	}

	public void setMinorWeigh(float minorWeigh) {
		this.minorWeigh = minorWeigh;
	}

	public int getSizeBegin() {
		return sizeBegin;
	}

	public void setSizeBegin(int sizeBegin) {
		this.sizeBegin = sizeBegin;
	}

	public int getSizeEnd() {
		return sizeEnd;
	}

	public void setSizeEnd(int sizeEnd) {
		this.sizeEnd = sizeEnd;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public String getPhoto1() {
		return photo1;
	}

	public void setPhoto1(String photo1) {
		this.photo1 = photo1;
	}

	public String getPhoto2() {
		return photo2;
	}

	public void setPhoto2(String photo2) {
		this.photo2 = photo2;
	}

	public String getPhoto3() {
		return photo3;
	}

	public void setPhoto3(String photo3) {
		this.photo3 = photo3;
	}

	public String getPhoto4() {
		return photo4;
	}

	public void setPhoto4(String photo4) {
		this.photo4 = photo4;
	}

	@ManyToOne
	@JoinColumn(name = "RING_TYPE_ID")
	public RingType getRingType() {
		return ringType;
	}

	public void setRingType(RingType ringType) {
		this.ringType = ringType;
	}

	@Transient
	public float getSecondPrice() {
		return secondPrice;
	}

	public void setSecondPrice(float secondPrice) {
		this.secondPrice = secondPrice;
	}

}
